package com.ruoyi.literature.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.literature.mapper.LiteratureMapper;
import com.ruoyi.literature.domain.Literature;
import com.ruoyi.literature.service.ILiteratureService;

/**
 * 文献Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-24
 */
@Service
public class LiteratureServiceImpl implements ILiteratureService 
{
    @Autowired
    private LiteratureMapper literatureMapper;

    /**
     * 查询文献
     * 
     * @param literatureId 文献主键
     * @return 文献
     */
    @Override
    public Literature selectLiteratureByLiteratureId(Long literatureId)
    {
        return literatureMapper.selectLiteratureByLiteratureId(literatureId);
    }

    /**
     * 查询文献列表
     * 
     * @param literature 文献
     * @return 文献
     */
    @Override
    public List<Literature> selectLiteratureList(Literature literature)
    {
        return literatureMapper.selectLiteratureList(literature);
    }

    /**
     * 新增文献
     * 
     * @param literature 文献
     * @return 结果
     */
    @Override
    public int insertLiterature(Literature literature)
    {
        literature.setCreateTime(DateUtils.getNowDate());
        return literatureMapper.insertLiterature(literature);
    }

    /**
     * 修改文献
     * 
     * @param literature 文献
     * @return 结果
     */
    @Override
    public int updateLiterature(Literature literature)
    {
        return literatureMapper.updateLiterature(literature);
    }

    /**
     * 批量删除文献
     * 
     * @param literatureIds 需要删除的文献主键
     * @return 结果
     */
    @Override
    public int deleteLiteratureByLiteratureIds(Long[] literatureIds)
    {
        return literatureMapper.deleteLiteratureByLiteratureIds(literatureIds);
    }

    /**
     * 删除文献信息
     * 
     * @param literatureId 文献主键
     * @return 结果
     */
    @Override
    public int deleteLiteratureByLiteratureId(Long literatureId)
    {
        return literatureMapper.deleteLiteratureByLiteratureId(literatureId);
    }
}
